package JUC.CountDownLatch和cyclicBarrier和Semaphore的使用;

/**
 * @author CKC
 * @DateTime 2021/4/25 10:08
 */
public class TestDemo {
    public static void main(String[] args) {
        TestDemo testDemo = new TestDemo();
        Cat cat = testDemo.sd();
        System.out.println(cat.getA());
    }
    
    public Cat sd(){
        Cat cat = new Cat();
        
        try {
            System.out.println(10/0);
        } catch (Exception e) {
            e.printStackTrace();
            cat.setA(10);
            return cat;
        } finally {
            cat.setA(30);
//            return a;
        }
        return cat;
    }
}

class Cat{
    int a;
    
    public int getA() {
        return a;
    }
    
    public void setA(int a) {
        this.a = a;
    }
}